<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="content-search">

    <?= "<?php " ?>$form = ActiveForm::begin([
    	'options'=>['data-pjax' => 1,'class' => 'layui-form layui-form-pane'],
        'enableClientValidation'=>false,
        'action' => ['index'],
        'method' => 'get',
        'fieldConfig' => [
            'labelOptions' => ['class' => 'layui-form-label',],
            'inputOptions' => ['class' => 'layui-input','style'=>'width:100px,webkit-appearance:select'],
        ],
    ]); ?>

<?php
$count = 0;
foreach ($generator->getColumnNames() as $attribute) {
    if (++$count < 6) {
        echo "    <div class=\"layui-inline\">
    	<label class=\"layui-form-label\">".'<?= $model->attributeLabels'."()['$attribute'] ?></label>
        <div class=\"layui-input-inline\"><?= " . $generator->generateActiveSearchField($attribute). "->label(false) ?></div>
    </div>\n\n";
    } else {
        echo "    <?php // echo " . $generator->generateActiveSearchField($attribute) . "->label(false) ?>\n\n";
    }
}
?>
    <div class="layui-inline">
    	<div class="form-group field-companysearch-company_name">
        <?= "<?= " ?>Html::submitButton('搜索', ['class' => 'layui-btn']) ?>
        <?= "<?= " ?>Html::a('新增',['create'], ['class' => 'layui-btn']) ?>
        </div>
    </div>

    <?= "<?php " ?>ActiveForm::end(); ?>

</div>
